﻿using System.Collections.Generic;
using System.Diagnostics;
using Antlr.Runtime;
using Microsoft.VisualStudio.Package;

namespace DLanguagePackage
{
    /// <summary>
    /// the scanner operates on a line by line bases, so I don't think it will ever be asked to operate on more than one line
    /// thus, I will need to specially handle all tokens that can be split across a line, and enumerate the different
    /// possibilities of 'im in the middle of a multiline comment' or 'in the middle of a quotation' and then modify
    /// my scanner to handle those.
    /// </summary>
    class DScanner : IScanner
    {
        LexerWrapper lexerWrapper = new LexerWrapper();

        #region IScanner Members

        public bool ScanTokenAndProvideInfoAboutIt(TokenInfo tokenInfo, ref int state)
        {
            Debug.Assert(tokenInfo != null, "tokeninfo should not be null");
            return lexerWrapper.ScanTokenAndProvideInfoAboutIt(tokenInfo, ref state);
        }

        public void SetSource(string source, int offset)
        {
            lexerWrapper.SetSource(source, offset);
        }
        #endregion
    }
}
